package com.spzx.common.security.feign;

import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Feign 配置注册
 * OpenFeign远程调用时，会丢失请求头。通过自定义的FeignRequestInterceptor拦截器，挂载需要请求头，再发送请求，解决请求头丢失问题。
 *
 * @author spzx
 **/
@Configuration
public class FeignAutoConfiguration {
    @Bean
    public RequestInterceptor requestInterceptor() {
        return new FeignRequestInterceptor();
    }
}
